﻿<%@ Page Language="C#" MasterPageFile="~/Shared/Masters/List.master" AutoEventWireup="true"
    CodeFile="EvaluateList.aspx.cs" Inherits="Modules_Personal_EvaluateList" Title="绩效评分列表" Theme ="Default" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register TagPrefix="web" TagName="listtitle" Src="~/Shared/UserControls/ListTitle.ascx" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Assembly="YYControls" Namespace="YYControls" TagPrefix="yyc" %>

<asp:Content ContentPlaceHolderID="idList" ID="idListContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <script src="../../Scripts/DatePicker/WdatePicker.js" language="javascript"></script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <contenttemplate>
          <div class="crumb">
        <asp:Label runat="server" ID="lblTitle" Text="绩效评分"></asp:Label>
    </div>
    <div id="divFlow" runat="server">
        <div class="search" id="search">
            <table cellpadding="2" cellspacing="0" class="rtm_shb_b">
                <tr>
                  <%--  <td style="width: 100px;">
                        <asp:Label runat="server" ID="lblCode" Text="评分人:"></asp:Label>
                        <asp:DropDownList ID="ddlUserID" runat="server">
                        </asp:DropDownList>
                    </td>--%>
                    <td style="width: 100px;">
                        <asp:Label runat="server" ID="lblName" Text="指标套:"></asp:Label>
                        <asp:DropDownList ID="ddlTargetOwner" runat="server" width="280">
                        </asp:DropDownList>
                    </td>
                    <td style="width: 100px;">
                        <asp:Label runat="server" ID="Label2" Text="状态:"></asp:Label>
                        <asp:DropDownList ID="ddlStatus" runat="server" width="125">
                        <asp:ListItem Text="所有" Value="-1"></asp:ListItem>
                        <asp:ListItem Text="新增" Value="0"></asp:ListItem>
                        <asp:ListItem Text="呈批" Value="1"></asp:ListItem>
                        <asp:ListItem Text="审批通过" Value="2"></asp:ListItem>
                        <asp:ListItem Text="公示" Value="3"></asp:ListItem>
                        <asp:ListItem Text="已归档" Value="4"></asp:ListItem>
                        <asp:ListItem Text="审批不通过" Value="5"></asp:ListItem>
                          <asp:ListItem Text="已作废" Value="6"></asp:ListItem>                        
                        </asp:DropDownList>
                    </td>
                    <td>
                        <asp:Label runat="server" ID="lblUpdateTime" Text="录入时间:"></asp:Label></td>
                    <td>
                        <input class="Wdate" type="text" style="width: 120px;" id="txtDateFrom" runat="server"
                            onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" />&nbsp;&nbsp;&nbsp;<asp:Label
                                runat="server" ID="lblTo" Text="到:"></asp:Label>&nbsp;&nbsp;&nbsp;
                        <input class="Wdate" type="text" style="width: 120px;" id="txtDateTo" runat="server"
                            onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
                    </td>
                    <td class="rtm_shb_btn" style="white-space: nowrap">
                        <asp:Button ID="btnSearch" runat="server" Text="查询" OnClick="btnSearch_Click"></asp:Button>&nbsp;
                        <asp:Button ID="ResetLinkButton" runat="server" Text="重置" OnClientClick="reset();return false;">
                        </asp:Button>
                    </td>
                </tr>
            </table>
        </div>
        <div class="toolbar" id="toolbar">
            <h2>
                <web:listtitle ID="Listtitle1" runat="server" Title="绩效信息" />
            </h2>
            <asp:LinkButton ID="btnCreate" runat="server" OnClientClick="return openEditorAdd(this, 'add');" OnClick="btnCreate_Click"
                Visible="false">
                <asp:Label ID="lblCreatNew" runat="server" Text="">
                    <img runat="server" id="imgNew" src="../../Images/icon_new.gif" style="border: 0px" />绩效录入</asp:Label>
            </asp:LinkButton>
        </div>
        <yyc:SmartGridView ID="gvEvaluateList" runat="server" AutoGenerateColumns="False"
            AllowSorting="True" OnSorting="gvEvaluateList_Sorting" OnRowCommand="gvEvaluateList_RowCommand"
            OnRowDataBound="gvEvaluateList_RowDataBound" EmptyDataText="没有找到数据!">
           
            <Columns>
                <asp:TemplateField HeaderText="操作">
                    <itemtemplate>     
                      <table width="46px" style="text-align: left">                    
                        <tr>
                            <td style="border: 0px solid #fff;">            
                  <asp:ImageButton runat="server" CommandName="reload" CausesValidation="False" OnClientClick="return openEditor(this, 'edt');" 
                    ImageUrl="~/Images/icon_srh.gif" ToolTip="编辑"  _ID='<%#Eval("ID")%>' ID="ibtnSelect" ></asp:ImageButton>
                    </td>
                 
                     <td style="border: 0px solid #fff;">            
                  <asp:ImageButton runat="server" CommandName="his" CausesValidation="False" OnClientClick="return openEditorHis(this, 'his');" 
                    ImageUrl="~/Images/icon_srh.gif" ToolTip="查看历史"  _ID='<%#Eval("ID")%>' ID="ibtnHis" ></asp:ImageButton>
                    </td>
                    
                            <td style="border: 0px solid #fff;">
                    <asp:ImageButton runat="server" CommandName="del" CommandArgument='<%# Eval("ID") %>'  CausesValidation="False"  OnClientClick="return sureDelete();" ImageUrl="~/Images/com/dg_del.gif" ToolTip="删除" ID="ibtnDelete" ></asp:ImageButton>
                      </td>
                       </tr>
                       </table>
                </itemtemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="评分人" >
                    <itemtemplate>
                <asp:Label runat="server" Text='<%# GetUserNameByEvaluateID(Eval("ID"))%>'  CssClass="text_overflow"  ID="lblUserID"></asp:Label>
                </itemtemplate>
                    <headerstyle wrap="False" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="被考核人" SortExpression="Target_User_ID">
                    <itemtemplate>
                <asp:Label runat="server" Text='<%# GetUserName(Eval("Target_User_ID"))%>'  CssClass="text_overflow"  ID="lblTarget_User_ID"></asp:Label>
                </itemtemplate>
                    <headerstyle wrap="False" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="指标套" SortExpression="TargetOwner_ID">
                    <itemtemplate>
                <asp:Label runat="server" Text='<%# GetTargetOwner(Eval("TargetOwner_ID"))%>'  CssClass="text_overflow"  ID="lblTargetOwner_ID"></asp:Label>
                </itemtemplate>
                    <headerstyle wrap="False" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="状态" SortExpression="Status">
                    <itemtemplate>
                <asp:Label runat="server" Text='<%# Eval("Status").ToString()=="0"?"新增":Eval("Status").ToString()=="1"?"呈批":Eval("Status").ToString()=="2"?"审批通过": Eval("Status").ToString()=="3"?"公示":Eval("Status").ToString()=="4"?"已归档": Eval("Status").ToString()=="5"?"审批不通过":"已作废" %>'  CssClass="text_overflow"  ID="lblStatus"></asp:Label>
                </itemtemplate>
                    <headerstyle wrap="False" />
                </asp:TemplateField>
              <asp:TemplateField HeaderText="得分" SortExpression="TotalScore">
                    <itemtemplate>
                <asp:Label runat="server" Text='<%# GetTotalScore(Eval("ID"))%>'  CssClass="text_overflow"  ID="lblTotalScore"></asp:Label>
                </itemtemplate>
                    <headerstyle wrap="False" />
                </asp:TemplateField>
                <asp:BoundField DataField="Create_Time" HeaderText="录入时间" SortExpression="Create_Time"
                    DataFormatString="{0:yyyy-MM-dd}" />
            </Columns>
        </yyc:SmartGridView>
        <webdiyer:AspNetPager ID="AspNetPager" CssClass="aspNetPager" ShowBoxThreshold="1"
            runat="server" HorizontalAlign="Right" PageSize="10" AlwaysShow="True" FirstPageText="首页"
            LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页" Width="98%" CustomInfoClass="aspNetPager"
            LayoutType="Div" PageIndexBoxType="TextBox" ShowPageIndexBox="Auto" OnPageChanged="AspNetPager_PageChanged">
        </webdiyer:AspNetPager>
    </div>
    </contenttemplate> </asp:UpdatePanel>

    <script type="text/javascript">
        function openEditor(_this, action) {
        
       
            var url = "EvaluateUpdate.aspx";
            return default_openEditor(url, _this, action, 920, 640,true);
        } 
        
          function openEditorAdd(_this, action) {
        
       
            var url = "EvaluateAdd.aspx";
            return default_openEditor(url, _this, action, 920, 640,true);
        } 
        
          function openEditorHis(_this, action) {
        
       
            var url = "EvaluateTargetHistory.aspx";
            return default_openEditor(url, _this, action, 880, 340,true);
        } 
        
        function sureDelete()
        {
             return confirm("您确认要删除吗?");        
        }                      
        
        
    </script>

</asp:Content>
